package cn.doitedu.demo5;

import cn.doitedu.beans.UserAction;
import org.apache.flink.api.common.functions.RuntimeContext;
import org.apache.flink.util.Collector;
import org.roaringbitmap.longlong.Roaring64Bitmap;

import java.io.IOException;

public interface RuleCalculator {

    String ruleId();


    default void init(RuntimeContext runtimeContext, String ruleParamJson) throws IOException {
    }


    default void init(RuntimeContext runtimeContext, String ruleParamJson, Roaring64Bitmap preSelectBitmap) throws IOException {
    }


    void calc(UserAction userAction, Collector<String> out) throws IOException;



    boolean isNeedPreSelectBitmap();


}
